package com.entity.mapper;

import com.entity.Student;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by 2429916391@qq.com on 2017/2/16 17:09.
 */
@Component("stma")
public interface StudentMapper {

    @Select("select * from student where id = #{id}")
    public Student findById(int id);

    @Select("select * from student where 1=1 order by id desc")
    public List<Student> queryAll();

    /*-------映射的StudentMapper.xml------*/
    public int insert(Student student);

    public int save(@Param("name") String name, @Param("address") String address);

    //public int add(String name,String address);

    public List<Student> shows();
}
